package zdh.jfinabbsapp.api;

import org.kymjs.kjframe.KJHttp;

import java.util.List;

import zdh.jfinabbsapp.api.dao.GeneralTopic;
import zdh.jfinabbsapp.api.dao.Section;
import zdh.jfinabbsapp.api.dao.Topic;
import zdh.jfinabbsapp.api.dao.User;

/**
 * 作者：zdh1000
 * 创建时间： 2015/6/28 20:37
 * 邮箱：wdzdh1000@163.com
 */
public class API {
    public static KJHttp http = new KJHttp();
    public static String ROOT = "http://jfbbs.tomoya.cn/api";

    public static String getAllSectionsUrl() {
        return SectionAPI.getAllSectionsUrl();
    }

    public static List<Section> getAllSections(String json) {
        return SectionAPI.getAllSections(json);
    }


    public static String[] getAllSections(List<Section> list) {
        return SectionAPI.getAllSections(list);
    }

    public static String getTopicListUrl(String tab, int page) {
        return TopicAPI.getTopicListUrl(tab, page);
    }

    public static List<GeneralTopic> getTopicListByJson(String json) {
        return TopicAPI.getTopicListByJson(json);
    }

    public static boolean checkCache(String url) {
        return (http.getCache(url) != null ? true : false);
    }

    public static String getTopicUrl(String id) {
        return TopicAPI.getTopicUrl(id);
    }

    public static Topic getTopicByJson(String json) {
        return TopicAPI.getTopicByJson(json);
    }

    public static String getUserUrl() {
        return UserAPI.getUserUrl();
    }

    public static User getUserByToken(String json) {
        return UserAPI.getUserByToken(json);
    }

    public static String doToken(String token) {
        return UserAPI.doToken(token);
    }
}
